<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <ul></ul>
</body>
<script>
    let li = document.createElement('li');
    let ul = document.querySelector('ul');
    // 添加节点 node.appendChild() node是父级, child是子级 
    ul.appendChild(li);
    let li1 = document.createElement('li');
    ul.insertBefore(li1, ul.children[0]);
</script>
</html>